<!doctype html>
<html class="no-js" lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>登录</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="static/img/apple-touch-icon.png">
    <link rel="shortcut icon" type="image/x-icon" href="static/img/icon/favicon.ico">
    <!-- Place favicon.ico in the root directory -->


    <!-- all css here -->
    <link rel="stylesheet" href="static/css/bootstrap.min.css">
    <link rel="stylesheet" href="static/css/font-awesome.min.css">
    <link rel="stylesheet" href="static/css/elegant-font.css">
    <link rel="stylesheet" href="static/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="static/css/meanmenu.min.css">
    <link rel="stylesheet" href="static/css/magnific-popup.css">
    <link rel="stylesheet" href="static/css/animate.css">
    <link rel="stylesheet" href="static/css/owl.carousel.min.css">
    <link rel="stylesheet" href="static/css/animate-heading.css">
    <link rel="stylesheet" href="static/css/owl.theme.default.min.css">
    <link rel="stylesheet" href="static/css/jquery-ui.css">
    <link rel="stylesheet" href="static/css/shortcode/shortcodes.css">
    <link rel="stylesheet" href="static/css/style.css">
    <link rel="stylesheet" href="static/css/responsive.css">
    <script src="static/js/vendor/modernizr-2.8.3.min.js"></script>
    <script src="static/js/jquery.alerts.js"></script>
</head>
<body class="other-page">


<!--[if lt IE 8]>
    <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Header Area Start -->
<header>
    <!-- Header Menu Area -->
    <div class="menu-area mt-60">
        <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-12">
                    <div class="logo-area text-center text-uppercase res-logo-sm">
                        <a href="index.html"><img src="static/img/icon/logo.png" alt=""/></a>
                    </div>
                </div>
                <div class="col-md-9 col-sm-12">

                </div>
            </div>
        </div>
    </div>

    <!-- Banner Area Start -->
    <div class="banner-area pb-90 pt-160 bg-2">
        <div class="container">
            <div class="row">
                <div class="banner-content text-center text-white">
                    <h1>login</h1>
                    <ul>
                        <!--								<li><a href="index.html">home</a> <span class="arrow_carrot-right "></span></li>-->
                        <!--								<li>Login</li>-->
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- Banner Area End -->
</header>
<!-- Header Area End -->
<!-- Page Content Wraper Area Start -->
<section class="page-content-wrapper login-area ptb-100">
    <div class="container">
        <div class="row">
            <div class="col-md-6 col-lg-6 col-sm-6 res-mb-25">
                <div class="account-info">

                    <div class="form-fields">
                        <h2>登录</h2>
                        <p>
                            <label>
                                邮箱账号
                                <span class="required">*</span>
                            </label>
                            <input id="user_name" type="text">
                        </p>
                        <p>
                            <label>
                                密码
                                <span class="required">*</span>
                            </label>
                            <input id="pass_word" type="password">
                        </p>
                    </div>
                    <div class="form-action">
                        <!--									<label>-->
                        <!--									<a href="#" class="lost_password"></a>-->
                        <!--										<input type="checkbox">-->

                        <!--									</label>-->
                        <label id="loglab" style=""></label>
                        <input value="登录" type="submit" onclick="LOGIN.log()">
                    </div>

                </div>
            </div>
            <div class="col-md-6 col-lg-6 col-sm-6">

                <div class="form-fields">
                    <h2>注册</h2>
                    <p>
                        <label>邮箱地址 <span class="required">*</span></label>
                        <input type="text" name="username" id="regName">
                    </p>
                    <p>
                        <label>密码 <span class="required">*</span></label>
                        <input type="password" name="password" id="pwd">
                    </p>
                </div>
                <div class="form-action">
                    <label id="reglab" style=""></label>
                    <input value="注册" type="submit" onclick="REGISTER.reg()">
                </div>

            </div>
        </div>
    </div>
</section>
<!-- Page Content Wraper Area End -->
<!-- Fotter Area Start -->
<footer>
    <!-- Footer Top Area End -->
    <div class="fotter-area dark-gray-bg ptb-100">
        <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-4 col-xs-12">
                    <div class="address-area res-mb-sm-30">
                        <a href="index.html">shopzon</a>
                        <p>Lorem ipsum dolor sit amet, consemi cteta dipisi cing elit, sed do eiusmod tempor.</p>
                        <div class="contact-social mt-40">
                            <ul>
                                <li>
                                    <a href="#" class="social_facebook "></a>
                                </li>
                                <li>
                                    <a href="#" class="social_twitter "></a>
                                </li>
                                <li>
                                    <a href="#" class="social_googleplus"></a>
                                </li>
                                <li>
                                    <a href="#" class="social_linkedin "></a>
                                </li>
                                <li>
                                    <a href="#" class="social_instagram "></a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-4 col-xs-12 xs-res-mrbtm">
                    <div class="footer-menu res-mb-sm-30">
                        <h4>MY ACCOUNT</h4>
                        <ul>
                            <li><a href="#">FAQs</a></li>
                            <li><a href="#">Payments</a></li>
                            <li><a href="#">Track Your Order</a></li>
                            <li><a href="#">Return Polcy</a></li>
                            <li><a href="#">Warranty</a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-md-3 hidden-sm hidden-xs">
                    <div class="footer-menu">
                        <h4>SHOP GUIDE</h4>
                        <ul>
                            <li><a href="#">Hot Sale</a></li>
                            <li><a href="#">Best Sellar</a></li>
                            <li><a href="#">Suppliers</a></li>
                            <li><a href="#">Our Store</a></li>
                            <li><a href="#">Deal of The Day</a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-md-3 col-sm-4 col-xs-12 xs-res-mrbtm">
                    <div class="footer-menu">
                        <h4>CONTACT INFO</h4>
                        <div class="contact-details">
                            <ul>
                                <li>
                                    <span class="icon_pin"></span>
                                    <p>Lusmod tempor incididunt</p>
                                </li>
                                <li>
                                    <span class="icon_mail"></span>
                                    <p>Lusmod incidiunt wesbvu</p>
                                </li>
                                <li>
                                    <span class="icon_phone "></span>
                                    <p>(256) 987 654 321</p>
                                </li>
                                <li>
                                    <span class="icon_clock_alt"></span>
                                    <p>8.00 am-6.00 pm</p>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Footer Top Area End -->
    <!-- Footer Bottom Area Start -->
    <div class="footer-bottom-area black-bg">
        <div class="container">
            <div class="row ">
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <p>Copyright &copy; 2020.Company name All rights reserved.</p>
                </div>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <img src="static/img/icon/payment.png" alt=""/>
                </div>
            </div>
        </div>
    </div>
    <!-- Footer Bottom Area End -->
</footer>
<!-- Fotter Area End -->

<!-- all js here -->
<script src="static/js/vendor/jquery-1.12.4.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/owl.carousel.min.js"></script>
<script src="static/js/isotope.pkgd.min.js"></script>
<script src="static/js/jquery.nivo.slider.js"></script>
<script src="static/js/jquery.simpleLens.min.js"></script>
<script src="static/js/jquery.magnific-popup.min.js"></script>
<script src="static/js/animated-heading.js"></script>
<script src="static/js/price-slider.js"></script>
<script src="static/js/jquery.ajaxchimp.min.js"></script>
<script src="static/js/jquery.countdown.js"></script>
<script src="static/js/jquery.meanmenu.js"></script>
<script src="static/js/plugins.js"></script>
<script src="static/js/main.js"></script>
</body>
</html>

<script type="text/javascript">
    var REGISTER = {
        param: {
            //单点登录系统的url
            surl: "${SSOURL}"
        },
        beforeSubmit: function () {

            //检查用户是否已经存在
            $.ajax({
                url: REGISTER.param.surl + "/user/check/" + escape($("#regName").val()) + "/1?r=" + Math.random(),
                success: function (data) {
                    if (data.code == 200) {
                        //检查手机号是否存在
                        // $.ajax({
                        // 	url : REGISTER.param.surl + "/user/check/"+$("#phone").val()+"/2?r=" + Math.random(),
                        // 	success : function(data) {
                        // 		if (data.data) {
                        // 			REGISTER.doSubmit();
                        // 		} else {
                        // 			showError("phone","phoneErr",defaultArr[9]);
                        // 		}
                        // 	}
                        // });
                        REGISTER.doSubmit();
                    } else {
                        $("#reglab").html(data.msg);
                        $("#reglab").css("color", "red");
                    }
                }
            });

        },
        doSubmit: function () {
            var username = $("#regName").val();
            var pwd = $("#pwd").val();
            $.post("/user/register", {"username": username, "password": pwd}, function (data) {
                if (data.code == 200) {
                    // jAlert('用户注册成功，请登录！',"提示", function(){
                    // 	REGISTER.login();
                    // });
                    $("#reglab").html('用户注册成功，左侧即可登录！');
                    $("#reglab").css("color", "green");
                } else {
                    $("#reglab").html(data.msg);
                    $("#reglab").css("color", "red");
                }
            });
        },
        reg: function () {
            this.beforeSubmit();
        }
    };
</script>

<script type="text/javascript">
    var LOGIN = {
        param: {
            //单点登录系统的url
            surl: "${SSOURL}"
        },
        beforeSubmit_Login: function () {
            var username = $("#user_name").val();
            var pwd = $("#pass_word").val();
            if (username == '') {
                $("#loglab").html('请输入邮箱账号！');
                $("#loglab").css("color", "red");
            } else if (pwd == '') {
                $("#loglab").html('请输入密码！');
                $("#loglab").css("color", "red");
            } else {
                this.doSubmit_Login();
            }

        },

        doSubmit_Login: function () {
            var username = $("#user_name").val();
            var pwd = $("#pass_word").val();
            $.post("/user/login", {"username": username, "password": pwd}, function (data) {
                if (data.code == 200) {
                    $("#loglab").html('用户登录成功！');
                    $("#loglab").css("color", "green");
                    LOGIN.login();
                } else {
                    $("#loglab").html(data.msg);
                    $("#loglab").css("color", "red");
                }
            });
        },
        login: function () {
            window.location.href = "${HOMEURL}";
        },
        log: function () {
            this.beforeSubmit_Login();
        }
    };
</script>

